package com.example.demo.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
public class TestController2 {

    @RequestMapping("/getname")
    public String test(String name,int id) {
        return "江湖小虾米" + name + id;
    }

//    @RequestMapping("/getname")
//    public String test(HttpServletRequest request) {
//        // servlet写法
//        return "江湖小虾米" + request.getParameter("name");
//    }
}
